home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / SASETUP.MSI / F77707_tserver_prop.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  4.3 KB  |  217 lines

  1. <%@ Language=VBScript   %>
  2. <%    Option Explicit     %>
  3.  
  4. <%
  5.     '==================================================
  6.     '    Terminal Services Web Client
  7.     '
  8.     '    Copyright (c) Microsoft Corporation.  All rights reserved. 
  9.     '
  10.     '==================================================
  11. %>
  12. <!-- #include virtual="/admin/sh_page.asp" -->
  13.  
  14. <%
  15. Function GetPathToHost()
  16.  
  17.     GetPathToHost = m_VirtualRoot
  18.     
  19. End Function
  20.  
  21. Function GetUserName()
  22.     Dim domainAndUser
  23.     Dim loginUser
  24.     Dim user
  25.     
  26.     loginUser = Request.ServerVariables("LOGON_USER")
  27.     domainAndUser = Split(loginUser, "\")
  28.     If IsArray(domainAndUser) Then
  29.         GetUserName = domainAndUser(UBound(domainAndUser))
  30.     Else
  31.         GetUserName = loginUser
  32.     End If
  33. End Function
  34.  
  35. %>
  36.  
  37.  
  38. <%
  39.  
  40.     Dim WinNTSysInfo     'Getting object
  41.     Dim strComputerName(1)     'Computer name
  42.  
  43.     DIM L_PAGETITLE_TEXT
  44.     DIM L_WINCLIENT_ERROR
  45.     
  46.     L_WINCLIENT_ERROR = GetLocString("tserver.dll", "40420005", "")
  47.     
  48.     Set WinNTSysInfo = CreateObject("WinNTSystemInfo")
  49.     strComputerName(0) = WinNTSysInfo.ComputerName
  50.     L_PAGETITLE_TEXT = GetLocString("tserver.dll", "40420004", strComputerName )
  51.  
  52.     Dim  L_ERRMSG_TITLE                    
  53.     Dim L_ERRMSG_PROMPT
  54.     Dim L_TSERVER_LOADOCX_ERROR_MSG
  55.  
  56.     L_ERRMSG_TITLE = GetLocString("tserver.dll", "40420007", "")    
  57.     L_ERRMSG_PROMPT = GetLocString("tserver.dll", "40420006", strComputerName)
  58.     L_TSERVER_LOADOCX_ERROR_MSG = GetLocString("tserver.dll", "40420008", "")
  59.  
  60.     ServePage
  61.     
  62. %>
  63.  
  64. <%
  65. Function ServeContent()
  66. %>
  67.     <script language="JavaScript">
  68.     function ValidatePage() 
  69.     { 
  70.             return true;
  71.     }
  72.         
  73.     function Init() 
  74.     {   
  75.     }
  76.             
  77.     function SetData()
  78.     {
  79.     }    
  80.  
  81.     </script>
  82.  
  83. <%
  84.     If ( IsIE() AND InStr( Request.ServerVariables("HTTP_USER_AGENT"), "Windows")) Then
  85. %>
  86.     <script language="VBScript">
  87.     
  88.     Sub window_onLoad()
  89.         on error resume next    
  90.         Err.Clear
  91.                 
  92.         If not "<%Response.Write(GetServerName())%>" = "" Then
  93.             srvName = "<%Response.Write(GetServerName()) %>"
  94.         Else
  95.             srvName = Document.location.hostname
  96.         End If
  97.  
  98.         Dim objMsTsc
  99.         objMsTsc = Document.all("MsTsc")
  100.         If ( Err.Number <> 0 ) Then
  101.             
  102.         Else
  103.             Document.all.MsTsc.Server     =  srvName
  104.             Document.all.MsTsc.UserName = "<%=GetUserName()%>"
  105.       
  106.             Document.all.MsTsc.Connect()
  107.         End If
  108.       
  109.     End Sub
  110.     
  111.     sub MsTsc_OnDisconnected(disconnectCode)
  112.         if not disconnectCode = 2 then
  113.  
  114.             msgbox "<%Response.Write(L_ERRMSG_PROMPT) %>", , "<%Response.Write(L_ERRMSG_TITLE) %>"
  115.  
  116.             Window.close()
  117.             'Window.History.back()
  118.         else
  119.             Window.close()
  120.             'Window.Navigate("<%=m_VirtualRoot + "tasks.asp?tab1=TabMaintenance"%>")
  121.         end if
  122.     end sub
  123.     
  124.     </script>
  125. <%
  126.     End If
  127. %>
  128.     
  129.     
  130.  
  131.     <center>
  132.     <table>
  133.     <tr>
  134.     
  135. <%
  136.     If ( IsIE() AND InStr( Request.ServerVariables("HTTP_USER_AGENT"), "Windows")) Then
  137. %>
  138.  
  139.     <OBJECT language="vbscript" ID="MsTsc"
  140.     CLASSID="CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a"
  141.     CODEBASE="<%=SAI_GetTSClientCodeBase()%>"
  142.    
  143.     <%
  144.     Dim resWidth
  145.     resWidth = Request.QueryString("rW")
  146.     If  resWidth < 200 or resWidth > 1600 Then
  147.         resWidth = 800
  148.     End If
  149.     Response.Write("WIDTH="+CStr(resWidth)+" ")
  150.     
  151.  
  152.     Dim resHeight
  153.     resHeight = Request.QueryString("rH")
  154.     If resHeight < 200 or resHeight > 1200 Then
  155.         resHeight = 600
  156.     End If
  157.     Response.Write("HEIGHT="+CStr(resHeight) + " " )
  158.     %>
  159.     
  160.     </OBJECT>
  161. <%
  162.     End If
  163. %>
  164.     
  165.     </tr>
  166.         
  167.     </table>
  168.     </center>
  169. <%
  170. End Function
  171. %>
  172.  
  173. <%
  174. Sub ServePage
  175. %>
  176. <HTML>
  177. <head>
  178. <meta http-equiv="Content-Type" content="text/html; charset=<%=GetCharSet()%>">
  179. <TITLE><%=L_PAGETITLE_TEXT%></TITLE>
  180. <%            
  181.     Call SA_EmitAdditionalStyleSheetReferences("")
  182. %>        
  183. <SCRIPT LANGUAGE="JavaScript" SRC="<%=m_VirtualRoot%>sh_page.js"></SCRIPT>
  184. </HEAD>
  185. <BODY marginWidth ="0" marginHeight="0" onDragDrop="return false;" topmargin="0" LEFTMARGIN="0" oncontextmenu="//return false;"> 
  186. <%
  187.     
  188.     Dim bIsSupported
  189.     bIsSupported = false
  190.  
  191.     '
  192.     ' The Terminal Server ActiveX control is only supported on Windows Clients
  193.     ' running Internet Explorer.
  194.     '
  195.  
  196.     If IsIE() Then
  197.         If InStr( Request.ServerVariables("HTTP_USER_AGENT"), "Windows") Then
  198.             bIsSupported = true
  199.         End If
  200.     End If
  201.  
  202.     If ( bIsSupported ) Then
  203.         ServeContent
  204.     Else
  205.         Response.Write("<br><blockquote>")
  206.         Response.Write("<H2>"+Server.HTMLEncode(L_WINCLIENT_ERROR)+"</H2>")
  207.         Response.Write("</blockquote>")
  208.     End If
  209.  
  210. %>
  211. </BODY>
  212. </HTML>
  213. <%
  214. End Sub
  215. %>
  216.  
  217.